# Use an official OpenJDK 8 runtime as a parent image
FROM openjdk:17-jdk-alpine

# Set the working directory in the container
WORKDIR /app

# Copy the executable JAR file to the container
COPY target/gateway.jar /app/app.jar

# Expose the port the application runs on
EXPOSE 9010

# Run the JAR file
# -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=20000
# -javaagent:/elastic-apm-agent.jar -Delastic.apm.service_name=backend -Delastic.apm.server_urls=http://apm-server:8200 -Delastic.apm.secret_token= -Delastic.apm.environment=production -Delastic.apm.application_packages=vip.liux.backend
ENTRYPOINT ["sh", "-c", "exec java $JAVA_OPTS -Dname=gateway.jar -Duser.timezone=Asia/Shanghai -Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m -jar /app/app.jar"]
